package view;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.MouseListener;

import javax.swing.JFrame;

public class GameWindow extends JFrame {

	private OverlayContainer overlayContainer;
	
	public GameWindow() {
		this("Game Window");
	}
	
	public GameWindow(String title) {
		super(title);
		overlayContainer = new OverlayContainer(new Dimension(800,600) );//TODO make dimension more dynamic
		this.getContentPane().add(overlayContainer, BorderLayout.CENTER);
	}
	
	public Overlay addOverlay( String id, int position, Overlay o) {
		overlayContainer.addOverlay(id, position, o);
		return o;
	}
	
	public Overlay addOverlay( String id, Overlay o){
		overlayContainer.addOverlay(id, o);
		return o;
	}
	
	public int getOverlayCount() {
		return overlayContainer.getOverlayCount();
	}
	
	public Overlay getOverlay( int position) {
		return overlayContainer.getOverlay(position);
	}
	
	public Overlay getOverlay( String id) {
		return overlayContainer.getOverlay(id);
	}
	
	public Overlay removeOverlay( Overlay o) {
		return overlayContainer.removeOverlay(o);
	}
	
	public Overlay removeOverlay( int position) {
		return overlayContainer.removeOverlay(position);
	}
	
	public Overlay removeOverlay( String id) {
		return overlayContainer.removeOverlay(id);
	}
	
	public void addMouseListener( MouseListener listener ) {
		overlayContainer.addMouseListener( listener );
	}
	
}
